/*
 * @Author: 
 * @Date: 2022-02-08 14:45:20
 * @LastEditors: lqj
 * @LastEditTime: 2022-02-10 14:43:51
 * @Description: 容器，路由传参
 */
import React from 'react';
import qs from 'query-string'

export default function MsgDetail(props) {
  // console.log(props)
  // params参数 - props.match.params,  search(query)参数 - props.location.search, state参数 - props.location.state
  const { search, state } = props.location
  const { id, title } = search ? qs.parse(search) : state ? state : props.match.params
  return (
    <>
      <ul>
        <li>Id: {id || 0}</li>
        <li>Title: {title || ''}</li>
        <li>Content: ...</li>
      </ul>
    </>
  );
}
